Lock-free creation of hash tables in parallel

ABSTRACT

A hash table is created in parallel without requiring a lock or random accesses to memory. The hash table of a database system is logically partitioned and a separate thread is assigned to each partition of the hash table. As many separate threads as can fit their corresponding hash table partitions into the processor&#39;s cache are executed in parallel with other threads without a lock. Execution of a number of separate threads includes: scanning an input data table for a thread&#39;s partition and applying a hash function to each key, inserting data of keys that hash to the thread&#39;s partition into the thread&#39;s partition, and ignoring keys that do not hash to the thread&#39;s partition.

BACKGROUND

The present invention relates to creating hash tables, and morespecifically, to creating lock-free hash tables in parallel.

The performance of many database queries, and in particular more complexones that require combining results from multiple tables, typicallydepends on the efficiency of the relational join operator. For queriesreferencing more than a few rows, an efficient join method is a hashjoin. Each value of the join column is hashed by a hash function to avalue that indexes a bucket (entry) in the hash table. A typical hashjoin first builds hash tables for one or more smaller tables, usuallysmaller tables whose contents more readily fit into memory, againstwhich it then probes the rows of the larger table using a differentequality join predicate for each table probed. If the join predicate istrue, the qualifying rows are added to a result set. The hash functionmay introduce collisions, in which two distinct values of the same joincolumn may hash to the same bucket of the hash table.

Commodity, multi-core systems typically parallelize the creation andprobing of hash tables in an effort to improve join performance. Probingan in-memory hash table in parallel does not require any locking orlatching, as it requires read-only access. However, building a hashtable in parallel typically results in concurrent write access to thehash table, which requires a lock for synchronization. Locking a memoryregion for exclusive access is a time-consuming operation, particularlyin the presence of concurrent access to the same region by other insertoperations that have to wait for write access.

SUMMARY

According to an embodiment, a method, database system and computerprogram product are provided for creating a hash table in parallelwithout requiring a lock or random accesses to memory. The hash table ofa database system is partitioned and a separate thread is assigned toeach partition of the hash table. A number of separate threads executein parallel with other threads without a lock. The execution of a numberof separate threads includes: scanning an input data table for athread's partition and applying a hash function to each key, insertingdata of keys that hash to the thread's partition into the thread'spartition, and ignoring keys that do not hash to the thread's partition.

Additional features and advantages are realized through the techniquesof the present invention. Other embodiments and aspects of the inventionare described in detail herein and are considered a part of the claimedinvention. For a better understanding of the invention with theadvantages and the features, refer to the description and to thedrawings.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

The subject matter which is regarded as the invention is particularlypointed out and distinctly claimed in the claims at the conclusion ofthe specification. The forgoing and other features, and advantages ofthe invention are apparent from the following detailed description takenin conjunction with the accompanying drawings in which:

FIG. 1 depicts a diagrammatic representation of the creation of a hashtable in parallel according to the contemporary art;

FIG. 2 depicts a diagrammatic representation of the creation of a hashtable in parallel according to the contemporary art;

FIG. 3 depicts a flow chart of a lock-free creation of a hash table inparallel according to an embodiment; and

FIG. 4 depicts a diagrammatic representation of a lock-free creation ofa hash table in parallel according to an embodiment.

DETAILED DESCRIPTION

Embodiments disclosed herein drive hashing from the perspective of ahash table and not from an input table. Particularly, embodimentspartition the hash table instead of partitioning the input table. Theinput table is sequentially scanned once for each hash table partitionin parallel using a separate thread for each hash table partition.Accordingly, exemplary embodiments execute each separate thread inparallel for each hash table partition without requiring a lock orrandom accesses to memory.

Referring now to FIG. 1, a block diagram of a computer system 10suitable for creating lock-free hash tables in parallel according toexemplary embodiments is shown. Computer system 10 is only one exampleof a computer system and is not intended to suggest any limitation as tothe scope of use or functionality of embodiments described herein.Regardless, computer system 10 is capable of being implemented and/orperforming any of the functionality set forth hereinabove.

Computer system 10 is operational with numerous other general purpose orspecial purpose computing system environments or configurations.Examples of well-known computing systems, environments, and/orconfigurations that may be suitable for use with computer system 10include, but are not limited to, personal computer systems, servercomputer systems, thin clients, thick clients, cellular telephones,handheld or laptop devices, multiprocessor systems, microprocessor-basedsystems, set top boxes, programmable consumer electronics, network PCs,minicomputer systems, mainframe computer systems, and distributed cloudcomputing environments that include any of the above systems or devices,and the like. Special-purpose computer systems include hardwareaccelerators such as FPGAs (Field-Programmable Gate Arrays), GPUs(Graphics Processing Units), and similar systems, which may be used inlieu of or in addition to general-purpose processors.

Computer system 10 may be described in the general context of computersystem-executable instructions, such as program modules, being executedby the computer system 10. Generally, program modules may includeroutines, programs, objects, components, logic, data structures, and soon that perform particular tasks or implement particular abstract datatypes. Computer system 10 may be practiced in distributed cloudcomputing environments where tasks are performed by remote processingdevices that are linked through a communications network. In adistributed computing environment, program modules may be located inboth local and remote computer system storage media including memorystorage devices.

As shown in FIG. 1, computer system 10 is shown in the form of ageneral-purpose computing device, also referred to as a processingdevice. The components of computer system may include, but are notlimited to, one or more processors or processing units 16, a systemmemory 28, and a bus 18 that couples various system components includingsystem memory 28 to processor 16. Computer system 10 includes a chipset12 to manage the data flow between the processor 16, memory 28 andexternal devices 14.

Bus 18 represents one or more of any of several types of bus structures,including a memory bus or memory controller, a peripheral bus, anaccelerated graphics port, and a processor or local bus using any of avariety of bus architectures. By way of example, and not limitation,such architectures include Industry Standard Architecture (ISA) bus,Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, VideoElectronics Standards Association (VESA) local bus, and PeripheralComponent Interconnects (PCI) bus.

Computer system 10 may include a variety of computer system readablemedia. Such media may be any available media that is accessible bycomputer system/server 10, and it includes both volatile andnon-volatile media, removable and non-removable media.

System memory 28 can include computer system readable media in the formof volatile memory, such as random access memory (RAM). Computer systemmay also include cache memory 32. Computer system 10 may further includeother removable/non-removable, volatile/non-volatile computer systemstorage media. By way of example only, storage system 34 can be providedfor reading from and writing to a non-removable, non-volatile magneticmedia (not shown and typically called a “hard drive”). Although notshown, a magnetic disk drive for reading from and writing to aremovable, non-volatile magnetic disk (e.g., a “floppy disk”), and anoptical disk drive for reading from or writing to a removable,non-volatile optical disk such as a CD-ROM, DVD-ROM or other opticalmedia can be provided. In such instances, each can be connected to bus18 by one or more data media interfaces. As will be further depicted anddescribed below, memory 28 may include at least one program producthaving a set (e.g., at least one) of program modules that are configuredto carry out the functions of embodiments of the disclosure.

Computer system 10 may also communicate with one or more externaldevices 14 such as a keyboard, a pointing device, a display 24, etc.;one or more devices that enable a user to interact with computersystem/server 10; and/or any devices (e.g., network card, modem, etc.)that enable computer system/server 10 to communicate with one or moreother computing devices. Such communication can occur via Input/Output(I/O) interfaces 22. Still yet, computer system 10 can communicate withone or more networks such as a local area network (LAN), a general widearea network (WAN), and/or a public network (e.g., the Internet) vianetwork adapter 20. As depicted, network adapter 20 communicates withthe other components of computer system 10 via bus 18. It should beunderstood that although not shown, other hardware and/or softwarecomponents could be used in conjunction with computer system 10.Examples include, but are not limited to: microcode, device drivers,redundant processing units, external disk drive arrays, RAID systems,tape drives, and data archival storage systems, etc.

In contemporary disk-based systems, input data tables that do not fit inmemory (RAM) are partitioned to minimize the number of times that dataare accessed and to perform mostly sequential reads and writes to disk,because multiple scans of the input data and/or random accesses to thedata stored on disk are cost prohibitive. However, even when thesequential bandwidth of an individual disk reaches approximately 200MB/s, the bandwidth is reduced by orders of magnitude because access inparallel by multiple processes usually requires random accesses thatmove the disk arm when switching processes.

The growth of main memory capacities has made main-memory-residentdatabase systems more cost-effective. Contemporary main-memory databasesystems help alleviate disk-based input/output (I/O) bottlenecks, butrun into other bottlenecks. Even when all the requisite information forperforming a hash join is already in memory, hash table building andprobing, which both require random memory accesses, are the slowest andmost costly operations. Random memory accesses cause cache and, if used,translation look-aside buffer (TLB) misses, which on contemporaryprocessors incur latencies of up to 300 and 1000 compute cycles,respectively. Data stored in main memory can be accessed by parallelprocesses and/or threads simultaneously. In fact, memory bandwidth ofcontemporary multi-core architectures may peak at nearly 200 GB/s whenaccessed via parallel scans. Probing an in-memory hash table in paralleldoes not require any locking or latching, as it requires read-onlyaccess. However, building a hash table in parallel using the presentstate of the art results in concurrent write access to the hash table,which requires some form of synchronization.

FIG. 2 depicts a diagrammatic representation of the creation of a hashtable 210 in parallel according to the contemporary art. As shown inFIG. 2, each partition—e.g., rows 221-223, 224-226, 227-229—of inputtable 220 is scanned in parallel and tuples are randomly inserted intothe hash table 210. The location of the insert position is based on ahash value computed from the input tuple, specifically its primary key.Exclusive access to a location in the hash table 210 where a tuple isinserted is typically enforced by a latch or lock synchronizationmechanism to prevent simultaneous updates to the same hash bucket bydifferent threads 230, 240, 250 as shown in FIG. 2, that cause resultswritten by one thread to be erroneously overwritten by the other.Locking a memory region of the hash table 210 for exclusive access is atime-consuming operation, particularly in the presence of concurrentaccess to the same region by other insert operations that have to waitfor write access.

One method for minimizing locking while creating a hash table inparallel relies on partitioning the input data and having each parallelprocess build a separate “local” hash table for its individualpartition. However, locking is eventually required to combine theseindividual hash tables, unless each probe is executed against all localhash tables. For hash tables that fit into the processor cache, thismight be a viable alternative, but otherwise the cost of repeated randommemory accesses will outweigh the cost of synchronization required tocreate a single hash table.

Another method for minimizing locking while creating a hash table inparallel relies on partitioning both input tables to a join, such thateach sub-table only needs to be joined with one other sub-table withoutrequiring a cross product of all sub-tables. Because the data arealready in memory, the tables are partitioned based upon their hashprefix. This allows the actual join to be executed in parallel withoutany further synchronization because the hash tables are created persub-table, and probing is limited to sub-tables that share the same hashprefix. As a result no locking is required, even when inserting data inparallel into sub-tables.

However, this method requires two scans of each table or intermediateresult to be joined, one scan for partitioning the rows and one scan forthe actual join. The size of a sub-table is usually chosen such that itfits into the processor cache to speed up subsequent operations. Giventhe relatively small size of processor caches, large input tablesproduce a significant number of sub-tables. This in turn results in manydistinct memory references, which cause cache and TLB misses duringpartitioning. Multi-phase partitioning may help to limit the number ofdistinct memory references, but requires additional scans of the inputdata. Even though this method yields an acceptable hash joinperformance, its partitioning phase is a bottleneck. During thepartitioning phase, this method still requires some locking, and randommemory accesses cannot be avoided. Locking is required when aggregatinghistograms, and using hash prefixes to partition a data set results inrandom memory accesses while moving data to target locations computed bythe hash prefix. Moreover, with growing input table size, this methodrequires multiple partitioning passes, each of which requires scanningall input data and writing them to new, random locations.

With reference to FIGS. 3 and 4, an embodiment for creating a lock-free,hash table 410 in parallel is shown. The processing unit 16 of FIG. 1drives hashing and creation of a hash table 410 from the perspective ofa hash table and not from an input data table 420 according to anembodiment. In other words, an embodiment makes the hash table 410 anactive object in the creation of the hash table 410, instead of apassive one as in previous approaches.

In block 310, a hash table 410 is partitioned such that each hash tablepartition 430, 440, 450 fits into a processor cache according to anembodiment. A hash table partition size that fits into the processor'scache minimizes main memory accesses during hash table creation. Inblock 320, a separate thread is assigned to each partition 430, 440, 450of the hash table 410. Accordingly, only the single thread assigned to aparticular hash table partition can write to or modify hash bucketswithin that particular hash table partition. As a result, a thread canprogress independently of other threads without any need forsynchronization.

In block 330, each separate thread executes in parallel to create itspartition of the hash table 410. In an embodiment, the execution of athread includes scanning each row 421, 422, 423, 424, 425, 426, 427,428, 429 of the input table 420 and applying the hash function to eachkey as shown in block 340. If the hash result falls into that thread'shash partition, the key-data pair (e.g., a row, a row ID, or any valueassociated with the key) is inserted into the hash partition assigned tothe thread as shown in block 350. For example, the hash result of inputtable rows 421,423, 425, 427 fall into hash table partition 430, thehash result of input table rows 422, 428, 429 fall into hash tablepartition 440, and the hash result of input table rows 424, 426 fallsinto hash table partition 450, as shown in detail in FIG. 4.

The input table 420 is scanned once for each hash table partition inparallel. This embodiment requires scanning the input table 420 as manytimes as there are hash table partitions 430, 440, 450. However, becausethe scanning can be done in parallel by multiple threads, no requirementto lock for synchronization or to access memory via random accesses willbe necessary.

In block 360, embodiments simply ignore and bypass rows which containkeys that do not hash to a particular thread's assigned hash partition,because another thread assigned to another hash partition of the hashtable 410 will take care of inserting those keys. Paying the cost ofmultiple passes over the input data table 420 avoids locking the entirehash table 410 or a row of the hash table for inserts, as only onethread is responsible for each hash table partition 430, 440, 450.

There are multiple reasons why scanning the input data table 420 overand over is advantageous. First, sequential or streaming access to datastored in main memory or in secondary storage is known to besignificantly faster than random access by more than an order ofmagnitude. Second, in multi-core architectures, a single thread cannotsaturate memory bandwidth. Multiple threads are necessary to achieveoptimal memory performance. Third, scans can be shared by multiplethreads according to an embodiment. Once the thread has completed itsscan of the input data table 420, addresses of that thread's hash tablepartition will no longer be referenced and can be flushed to mainmemory. It should be noted that the total number of threads that areactive concurrently can be significantly lower than the number of hashtable partitions.

Performance is governed by how fast the input table can be scanned byeach thread, and how fast the hash table partitions can be flushed orwritten back to main memory. The resulting memory access patterns andparallel sequential reads and writes may be optimal for modernprocessors.

Accordingly, each thread can be executed independently and requires nosynchronization with other tasks according to disclosed embodimentsherein. Moreover, the scanning of input data results in strictlysequential memory accesses, and choosing a partition size less than orequal to the processor cache avoids cache and TLB misses for insertingtuples into the appropriate hash table partition.

The disclosed embodiments herein employ “embarrassingly parallel”computing in that there is no dependency or synchronization betweenparallel threads, and as such, embodiments are well matched tomulti-core architectures. Modern processor architectures requireparallel memory access from all cores in order to achieve maximum memoryperformance. As there is no synchronization required between threads inthe embodiments disclosed, all threads will be active continuously, asmany as required to saturate memory bandwidth of the targetarchitecture.

Hashing is known to raise the problem of collisions, in which more thanone distinct key hashes to the same location in the hash table.Embodiments provide resolution protocols to collisions via chaining andopen addressing. Chaining generates an overflow bucket to store theadditional colliding key, and links it to all other colliding keys forthat hash bucket. On the other hand, open addressing looks sequentiallyfor the next available slot in the hash table.

For both chaining and open addressing, a correct partition size isselected to avoid random memory access due to cache and/or TLB misses.Moreover, implementing chaining requires careful engineering to avoid anexcessive number of distinct memory references that can cause cache andTLB misses. Open addressing needs to address the case when there are noremaining slots in a partition. For example, to demonstrate the effectsof partition size, consider a processor with 64 TLB entries and anoperating system with 4 KB memory pages. In this case, only memoryaddresses within 64 distinct 4 KB pages can be accessed beforeencountering TLB misses. On contemporary processors, this is more likelyto be the limiting factor than their several megabytes of cache.

Chained hashing grows the partition size in the presence of collisions.Therefore, the partition size must be limited to the 64 buckets (i.e.,the number of TLB entries), each with a maximum size of 4 KB, which isequal to the page size. To avoid the cache and TLB misses that arecaused by following the pointers formed by the chained buckets, anembodiment creates an index for currently active buckets, that is,buckets that have space. As a result, full buckets or pages are nolonger referenced and will get flushed to main memory automatically overtime.

For open addressing, the size of each hash table partition should notexceed 256 KB, which is the number of TLB entries times the page size,to limit the cost of potentially scanning the entire partition to locatean unoccupied slot in case of a collision.

For open addressing, a problem may arise when a collision occurs and thesearch for a free slot reaches the end of a partition. Simply continuingthe search at the beginning of the partition requires storing eachpartition boundary and probing the hash table in exactly the same wayand not allowing for linear scans for matching keys. Moreover, this doesnot cover the case when a partition is completely full. Inserting datadirectly into the next partition requires coordination with the taskhandling that partition (i.e., locking).

Accordingly, an embodiment stores data in separate overflow buckets thatare processed after a thread has finished scanning the input table. Inother words, data that does not fit into a particular hash tablepartition is passed to another thread with an overflow bucket. Anotherembodiment provides an input queue for each hash table partition, towhich the task processing the preceding partition can add overflow datausing an atomic add.

Technical effects and benefits of the disclosed embodiments includeimproved performance for the creation of hash tables by eliminating anyrequirement to lock for synchronization or to access memory via randomaccesses (e.g., cache and TLB misses).

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CD-ROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain, or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described above with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

The disclosed flowchart and block diagrams illustrate the architecture,functionality, and operation of possible implementations of systems,methods and computer program products according to various embodimentsof the present invention. In this regard, each block in the flowchart orblock diagrams may represent a module, segment, or portion of code,which comprises one or more executable instructions for implementing thespecified logical function(s). It should also be noted that, in somealternative implementations, the functions noted in the block may occurout of the order noted in the figures. For example, two blocks shown insuccession may, in fact, be executed substantially concurrently, or theblocks may sometimes be executed in the reverse order, depending uponthe functionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts, or combinations of special purpose hardware andcomputer instructions.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the invention. Asused herein, the singular forms “a”, “an” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “comprises”and/or “comprising,” when used in this specification, specify thepresence of stated features, integers, steps, operations, elements,and/or components, but do not preclude the presence or addition of onemore other features, integers, steps, operations, element components,and/or groups thereof.

The corresponding structures, materials, acts, and equivalents of allmeans or step plus function elements in the claims below are intended toinclude any structure, material, or act for performing the function incombination with other claimed elements as specifically claimed. Thedescription of the present invention has been presented for purposes ofillustration and description, but is not intended to be exhaustive orlimited to the invention in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the artwithout departing from the scope and spirit of the invention. Theembodiment was chosen and described in order to best explain theprinciples of the invention and the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated

The flow diagrams depicted herein are just one example. There may bemany variations to this diagram or the steps (or operations) describedtherein without departing from the spirit of the invention. Forinstance, the steps may be performed in a differing order or steps maybe added, deleted or modified. All of these variations are considered apart of the claimed invention.

While the preferred embodiment to the invention had been described, itwill be understood that those skilled in the art, both now and in thefuture, may make various improvements and enhancements which fall withinthe scope of the claims which follow. These claims should be construedto maintain the proper protection for the invention first described.

What is claimed is:
 1. A method of lock-free creation of partitionedhash tables in parallel, comprising: partitioning a hash table of adatabase system; assigning a separate thread to each partition of thehash table; and executing a number of the separate threads in parallelwith other threads without a lock, the executing for each of saidnumber: scanning an input data table for a thread's partition andapplying a hash function to each key; inserting data of keys that hashto the thread's partition into the thread's partition; and ignoring keysthat do not hash to the thread's partition.
 2. The method of claim 1,wherein the scanning of the input data table results in strictlysequential memory accesses.
 3. The method of claim 1, wherein thecontents of the thread's partition are flushed to main memory inresponse to completing the executed thread.
 4. The method of claim 1,wherein each partition size is less than or equal to a cache size of theprocessing device.
 5. The method of claim 1, wherein an index is createdfor active buckets of the partition such that inactive buckets of thepartition are no longer referenced and are automatically flushed to mainmemory.
 6. The method of claim 1, wherein overflow data, in thepartition, are stored in separate overflow buckets to be processed byanother thread.
 7. The method of claim 1, wherein an input queue isprovided for each partition, enabling a thread processing of a precedingpartition to add overflow data to a subsequent input queue.
 8. Adatabase system of lock-free creation of partitioned hash tables inparallel, comprising: a memory having computer readable instructions;and a processor for executing the computer readable instructions, theinstructions comprising: partitioning a hash table of a database system;assigning a separate thread to each partition of the hash table; andexecuting a number of the separate threads in parallel with otherthreads without a lock, the executing for each of said number: scanningan input data table for a thread's partition and applying a hashfunction to each key; inserting data of keys that hash to the thread'spartition into the thread's partition; and ignoring keys that do nothash to the thread's partition.
 9. The database system of claim 8,wherein the scanning of the input data table results in strictlysequential memory accesses.
 10. The database system of claim 8, whereincontents of the thread's partition are flushed to main memory inresponse to completing the executed thread.
 11. The database system ofclaim 8, wherein each partition size is less than or equal to a cachesize of the processor.
 12. The database system of claim 8, wherein anindex is created for active buckets of the partition such that inactivebuckets of the partition are no longer referenced and are automaticallyflushed to main memory.
 13. The database system of claim 8, whereinoverflow data, in the partition are stored, in separate overflow bucketsto be processed by another thread.
 14. The database system of claim 8,wherein an input queue is provided for each partition, enabling a threadprocessing of a preceding partition to add overflow data to a subsequentinput queue.
 15. A computer program product for lock-free creation ofpartitioned hash tables in parallel, the computer program productcomprising a computer readable storage medium having program codeembodied therewith, the program code executable by a processor to:partition a hash table of a database system; assign a separate thread toeach partition of the hash table; and execute a number of the separatethreads in parallel with other threads without a lock, the executing foreach of said number: scanning an input data table for a thread'spartition and applying a hash function to each key; inserting data ofkeys that hash to the thread's partition into the thread's partition;and ignoring keys that do not hash to the thread's partition.
 16. Thecomputer program product of claim 15, wherein the scanning of the inputdata table results in strictly sequential memory accesses.
 17. Thecomputer program product of claim 15, wherein contents of the thread'spartition are flushed to main memory in response to completing theexecuted thread.